<form name="fenpei_form" id="fenpei_form" action="{:U('business/receive')}"  method="post">
	<input type="hidden" name="id" value="{$leads_id}"/>
	{:L('ASSIGN_THE_CLUES')}:<input type="hidden" name="owner_role_id" id="owner_role_id" value="{$Think.session.role_id}"/><input type="text" name="owner_name" id="owner_name" value="{$Think.session.name}"/>
	<p style="width:300px; float:right;">{:L('TO_DISTRIBUTE_THE_CLUES_TO_INFORM')}<input type="checkbox" name="message_alert" value="1" checked="checked">{:L('STAND_INSIDE_LETTER')} &nbsp; <if condition="F('sms')"><input type="checkbox" name="sms_alert" value="1">{:L('NOTE')} &nbsp; </if><input type="checkbox" name="email_alert" value="1">{:L('EMAIL')}</p>
</form>
<div id="dialog-message" title="{:L('SELECT_ALL_OF_THE_CONTACTS')}">loading...</div>
<script type="text/javascript">
$("#dialog-message").dialog({
	autoOpen: false,
	modal: true,
	width: 600,
	maxHeight: 400,
	buttons: {
		"Ok": function () {
			var item = $('input:radio[name="owner"]:checked').val();
			var name = $('input:radio[name="owner"]:checked').parent().next().html();
			$('#owner_name').val(name);
			$('#owner_role_id').val(item);
			$(this).dialog("close");
		},
		"Cancel": function () {
			$(this).dialog("close");
		}
	},
	position: ["center", 100]
});
$(function(){
	$("#owner_name").click(
		function(){
			$('#dialog-message').dialog('open');
			$('#dialog-message').load('{:U("user/listdialog")}');
		}
	);
});
</script>